﻿<UserControl
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:properties="clr-namespace:KBS.FamilyLines.Properties"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="KBS.FamilyLines.Repositories" Width="410" >


    <UserControl.Resources>
        <ResourceDictionary>
            <!-- Data Template for displaying the friendly name of the repository -->
            <DataTemplate x:Key="RepositoryTemplate">
                <TextBlock Text="{Binding Path=RepositoryNameAndId, Mode=Default}"/>
            </DataTemplate>
        </ResourceDictionary>
    </UserControl.Resources>

    <StackPanel>

        <!-- Header -->
        <Border Padding="5,0,5,0" Background="{DynamicResource BackgroundBrush}" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1,1,1,0" CornerRadius="5,5,0,0" Height="30">
            <Grid>
                <TextBlock Padding="20,0,0,0" Text="{x:Static properties:Resources.Repositories}" TextWrapping="Wrap" Foreground="{DynamicResource HeaderFontColor}" FontSize="18" FontWeight="Bold" d:LayoutOverrides="Height" VerticalAlignment="Center" HorizontalAlignment="Left"/>
                <Image HorizontalAlignment="Left" Source="..\Images\Repository.png" Height="20" />
                <Button Content="X" x:Name="CancelButton" Click="CancelButton_Click"  Height="15"  HorizontalAlignment="Right" Width="15" Style="{DynamicResource RedButtonStyle}"/>
            </Grid>
        </Border>

        <!-- Content -->
        <Border BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1,1,1,1" >

            <StackPanel Background="{DynamicResource InputBackgroundBrush}">
                <Label Content="{x:Static properties:Resources.RepositoryList}" Foreground="{DynamicResource InputFontColor}" />
                <ListBox  MinHeight="100" Height="100" ItemTemplate="{DynamicResource RepositoryTemplate}" ScrollViewer.VerticalScrollBarVisibility="Auto" x:Name="RepositoriesCombobox" SelectionChanged="RepositoriesCombobox_SelectionChanged" Margin="5,0,5,0" />

                <Label Content="{x:Static properties:Resources.Name}" Foreground="{DynamicResource InputFontColor}" />
                <TextBox TextWrapping="NoWrap" x:Name="RepositoryNameEditTextBox"  Margin="5,0,5,0" Height="22" />

                <Label Content="{x:Static properties:Resources.Address}" Foreground="{DynamicResource InputFontColor}" HorizontalAlignment="Left" Width="250" />
                <TextBox AcceptsReturn="True" TextWrapping="NoWrap" x:Name="RepositoryAddressEditTextBox" Margin="5,0,5,0" Height="22" />

                <StackPanel Orientation="Horizontal">
                    <Button Content="{x:Static properties:Resources.Save}"  x:Name="SaveButton" Click="SaveButton_Click"  Margin="5,7,0,7"  Width="Auto" MinWidth="60" Height="15"   Style="{DynamicResource RedButtonStyle}"/>
                    <Button Content="{x:Static properties:Resources.Add}"  x:Name="DeleteButton" Click="AddButton_Click"  Margin="5,7,0,7" Width="Auto" MinWidth="60" Height="15"  Style="{DynamicResource RedButtonStyle}" />
                    <Button Content="{x:Static properties:Resources.Delete}"  x:Name="AddButton" Click="DeleteButton_Click" Margin="5,7,0,7" Width="Auto" MinWidth="60" Height="15" Style="{DynamicResource RedButtonStyle}"/>
                    <Button Content="{x:Static properties:Resources.Export}" x:Name="ExportRepositoriesButton" Click="ExportRepositoriesButton_Click" Margin="5,7,0,7" Height="15" Width="Auto" MinWidth="60"  Style="{DynamicResource RedButtonStyle}"/>
                </StackPanel>
                
            </StackPanel>
        </Border>

        <!-- Footer -->
        <Border Opacity="100" Background="{DynamicResource BackgroundBrush}" Height="15" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1,0,1,1" CornerRadius="0,0,5,5"/>
        
    </StackPanel>
</UserControl>
